# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

inherit webapp eutils

DESCRIPTION="Anyterm is a combination of a web page and a web server module that
provides shell-access via a web-interface."
HOMEPAGE="http://www.gimpster.com/php-shell/"
SRC_URI="http://anyterm.org/download/${P}.tbz2"
IUSE=""
LICENSE="GPL-2"
KEYWORDS="~x86"
DEPEND=">=x11-libs/rote-0.2.8"
DOCS="README INSTALL"
src_compile() {
	cd apachemod
	emake || die "emake failed"

}

src_install() {
	local docs="CHANGELOG LICENSE README"
	dodoc ${docs}
	insinto /usr/lib/apache2-extramodules
	insinto ${PN}.la
	cd apachemod
	exeinto /usr/lib/apache2-extramodules
	doexe .libs/${PN}.so

	webapp_src_preinst

	local wdocs="anyterm.html anyterm.css anyterm.js sarissa.js .htaccess"
	cd ../browser	
	cp ${wdocs} ${D}${MY_HTDOCSDIR}
	for y in ${wdocs} ; do
		cp ${y} ${D}${MY_HTDOCSDIR}
		webapp_serverowned ${MY_HTDOCSDIR}/${y}
	done

	webapp_src_install
}
	einfo "LoadModule anyterm /usr/lib/apache2-extramodules/anyterm.so"

